home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ Aug 89 / X0081-2.0ß9 Idle⁄cohandle-Aug89 < prev    next >
Encoding:
Text File  |  1989-08-22  |  2.0 KB  |  55 lines  |  [TEXT/GEOL]

  1. Item    6736576                         18-Aug-89        15:28
  2.  
  3. From:   D0568                           Poseidon Systems, N Menendez,PRT
  4.  
  5. To:     MACAPP.TECH$                    MACAPP Tech
  6.  
  7. Sub:    2.0ß9 Idle/cohandler problem.
  8.  
  9.  
  10. We are writing an application that creates multiple event cohandlers that work
  11. in the idle (continue) of the application.  In the idle of each of the
  12. cohandlers, we receive/send data to windows approximately every second.
  13.  
  14. The problem is the following: when we compile the program with -Debug on (using
  15. MacApp 2.0ß9), everything works well; however, if we compile with -noDebug, the
  16. application seems to startup fine, but starts to put up the watch cursor for
  17. longer and longer periods of time (if we break into Macsbug, the heap is
  18. corrupt), and the data being sent to the windows seems to take forever.
  19.  
  20. If in the idle of the event cohandler we add gApplication.Beep(1);, everything
  21. works fine after compiled with -noDebug (see code fragment) !!! (with the added
  22. inconvenience of a beep every second or so)
  23.  
  24. We thought it was a segmentation problem, and have been trying to resegment the
  25. application, but the problem persists.
  26.  
  27. *************************** Code Fragment ***************************
  28. FUNCTION TInstmtHandler.DoIdle(phase: IdlePhase): BOOLEAN;
  29.    BEGIN
  30.    IF (phase = idleContinue) THEN
  31.       BEGIN        
  32.          { ***********
  33.          If we add gApplication.Beep(5); here, code works well under -NoDebug
  34.          }
  35.                  IF DataReceived THEN   {Routine that indicates data has been
  36. received}
  37.          BEGIN
  38.          {
  39.          Update Windows…
  40.          }
  41.          END                                   {IF DataReceived}
  42.       ELSE
  43.          BEGIN
  44.          {
  45.          Other idle time tasks…
  46.          }
  47.          END;
  48.       END;                                     {IF - phase = idleContinue}
  49.  
  50.    DoIdle := FALSE;
  51.    END;                                        {TInstmtHandler.DoIdle}
  52. *****************************************************************
  53.  
  54.  
  55.